<?php
	function nd_load_libraries($path)
		{
			// Ignore file lookup
			$ignore_files = array('config.php', 'start.php', '.', '..', 'CVS', '.svn');

			// Load the library files
			$files = array();

			if ($handle = opendir($path)) {
				while (false !== ($file = readdir($handle))) {
					if (!in_array($file, $ignore_files)) {
						if (!is_dir($path . $file)) {
							$files[] = ($path . $file);
						} else {
							$subhandle = opendir($path . $file);
							while (false !== ($subfile = readdir($subhandle))) {
								if (!in_array($subfile, $ignore_files)) {
									$files[] = ($path . $file . "/" . $subfile);
								}
							}
						}
					}
				}

				closedir($handle);
			}

			asort($files);
			foreach($files as $file) {
			
				if ((strpos($file, ".svn")===false) && (strpos($file, ".php")))
					require_once($file);
			}
			
        }
        
        nd_load_libraries(dirname(__FILE__) . "/services/");
?>